package cn.wolfcode.wolf2world.web.controller;

import cn.wolfcode.wolf2world.elasitcsearch.query.SearchQueryObject;
import cn.wolfcode.wolf2world.elasitcsearch.service.SearchService;
import cn.wolfcode.wolf2world.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杨兴健
 * @Date 2020/8/20 19:29
 */
@RestController
public class ElasticSearchController {

    @Autowired
    private SearchService searchService;

    @GetMapping("/q")
    public Object query(SearchQueryObject qo) {
        Object query = searchService.query(qo);
        return JsonResult.success(query);
    }
}
